package com.example.chapter04;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.TextView;
import com.example.chapter04.utils.Utils;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TextView tv_code=findViewById(R.id.tv_code);

        ViewGroup.LayoutParams params=tv_code.getLayoutParams();
        
        params.width= Utils.dip2px(this,300);

        tv_code.setLayoutParams(params);
    }
}